import { Injectable } from '@angular/core';
import { IBaseFormService } from './IBaseForm';

@Injectable()
export abstract class BaseFromService<T> implements IBaseFormService<T> {

    formData: T;

    constructor() {
        this.init();
    }

    abstract init(): any;

    beforeSubmit(): Promise<T> {
        return Promise.resolve(this.formData);
    }

    afterSubmit() {

    }

    submit(): Promise<T> {
        return Promise.resolve(this.formData);
    }
}

